package com.dinian.demeter.service.impl;

import com.dinian.demeter.domain.PlaceInfo;
import com.dinian.demeter.mapper.PlaceInfoMapper;
import com.dinian.demeter.service.PlaceInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PlaceInfoServiceImpl implements PlaceInfoService {

    @Autowired
    private PlaceInfoMapper placeInfoMapper;

    /**
     * 根据placeId查询位置信息
     * @param id
     * @return
     */
    @Override
    public PlaceInfo findPlaceInfoById(Long id) {
        PlaceInfo placeInfo = placeInfoMapper.queryPlaceInfoById(id);
        return placeInfo;
    }

    /**
     * 根据userId查询位置信息
     * @param userId
     * @return
     */
    @Override
    public List<PlaceInfo> findPlaceInfoByUserId(Long userId) {
        List<PlaceInfo> placeInfos = placeInfoMapper.queryPlaceInfoByUserId(userId);
        return placeInfos;
    }
}
